package com.futvan.z.framework.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	
	public static String getDate() {
		return getDateTime("yyyy-MM-dd");
	}
	
	public static String getDateTime() {
		return getDateTime("yyyy-MM-dd HH:mm:ss");
	}
	
	public static String getDateTime(String pattern) {
		SimpleDateFormat dateformat1 = new SimpleDateFormat(pattern);
		return dateformat1.format(new java.util.Date());
	}
	
	public static String FormatDate(Object date, String pattern) {
		if(date!=null) {
			SimpleDateFormat dateformat1 = new SimpleDateFormat(pattern);
			return dateformat1.format(date);
		}else {
			return "";
		}
		
	}
	
}
